package l2ft.gameserver.taskmanager;

import l2ft.commons.threading.RunnableImpl;
import l2ft.gameserver.ThreadPoolManager;
import l2ft.gameserver.model.GameObjectsStorage;
import l2ft.gameserver.model.Player;

public class KillingMonstersLogManager
{
	private static KillingMonstersLogManager _instance;
	
	public KillingMonstersLogManager()
	{
		ThreadPoolManager.getInstance().scheduleAtFixedRate(new CheckMonsterKill(), 1*60000, 1*60000);
	}
	
	private class CheckMonsterKill extends RunnableImpl
	{
		@Override
		public void runImpl() throws Exception
		{
			for(Player player : GameObjectsStorage.getAllPlayersForIterate())
			{
				if(player != null && player.isOnline())
				{
					player.stopMonsterKillAndLog();
				}
			}
		}
	}
	
	public static KillingMonstersLogManager getInstance()
	{
		if(_instance == null)
			_instance = new KillingMonstersLogManager();
		return _instance;
	}
}
